package com.gitee.somenvm.ninerpgitem.util

fun Any?.safeAsInt() : Int{
    return when (this) {
        is Int -> return toInt()
        is String -> return toString().filter { it.isDigit() }.toInt()
        else -> 0
    }
}